-
Notifications
You must be signed in to change notification settings - Fork 445
support loading COG layers from query params #9531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@dsuren1 help/feedback welcome on this. Even with |
|
ok it loads the cog with your tweak from #9527 (comment) but im not comfy with it.. maybe i should set name to the value of also, it doesn't automatically zoom to the COG extent even if it knows its bbox (i have the 'zoom to layer' button in the toc), while it's the case when the COG is added from the catalog. |
|
with 9f2f3c9 it works but i have to figure out what triggers the zoom to layer behaviour edit bah, dunno where i got that from, but loading a WMS layer from query params doesn't automagically zoom to the WMS layer either, so... a non-existent feature i might have dreamt of. setting PR to reviewable, feedback welcome |
|
Thank you so much for contributing @landryb. We will check this asap. This is still WIP n your side as reported din description? |
no this is ready for review, eslint is happy with the js changes, and i've just tested it backported on a local 2023.02 build of ms2-georchestra and it does what i expect, eg |
|
updated the issue description to state that it wasnt just WIP, but working for me :) it was already working in the initial PR from october, but it had stalled and bitrotted. |
|
can i get a review on this before it bitrots more ? should i rebase the branch or a merge commit like f22d540 above is acceptable ? |
|
@landryb Could you please align your changes with latest master. Thanks! |
|
@dsuren isnt there a problem with and the API in https://github.com/geosolutions-it/MapStore2/blob/master/web/client/utils/cog/LayerUtils.js#L56 i dunno if that matters.. but whatever order of parameters i put in my code, eslint complains if i try building the layer object/parameter on the fly: eslint is happy if i build the layer object before, as done in 0260ac7 (untested yet) |
|
return LayerUtils.getLayerConfig({url: _url, layer, controller}) |
ah, thanks, now i understand the logic, it wasnt obvious for me that the variable names were auto matched on object properties. fixed with 60e7269 and i've been able to successfully test it on a locally running instance with |
dsuren1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@landryb
Kindly update the docmap-query-parameters.md for adding COG layer via query paramater similar to other layer type. Also a note in the docs regarding the 'limitation' mentioned below. Thanks!
@offtherailz @tdipisa
The only limitation to adding COG layer via query parameter, is that it is not possible to cancel the metadata fetch call as there is not control exposed at the moment. So when a big source is requested the map load time maybe significantly affected.
|
@ElenaGallo Kindly test it in DEV and let us know if it can be backported. Thanks! |
|
test passed, @dsuren1 please backport to 2024.01.xx. Thanks |
* COG services only have a single layer, use provided layer text as title (geosolutions-it#9527) * create COG layer on the fly if none is provided (geosolutions-it#9527) * use properly named parameters for getLayerConfig call * return layer in case getLayerConfig failed * add documentation about loading COG layer via viewer parameters (geosolutions-it#9531) * Update docs/developer-guide/map-query-parameters.md --------- Co-authored-by: Suren <dsuren1@gmail.com> (cherry picked from commit 6b4d662)
|
@ElenaGallo @dsuren1 this is for 2024.01.01 so let's wait the delivery of 2024.01.00 before merging the backport. |
* COG services only have a single layer, use provided layer text as title (#9527) * create COG layer on the fly if none is provided (#9527) * use properly named parameters for getLayerConfig call * return layer in case getLayerConfig failed * add documentation about loading COG layer via viewer parameters (#9531) * Update docs/developer-guide/map-query-parameters.md --------- Co-authored-by: Suren <dsuren1@gmail.com> (cherry picked from commit 6b4d662) Co-authored-by: Landry Breuil <landryb@users.noreply.github.com>

Description
implements #9527
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
fixes #9527
What is the new behavior?
http://localhost:8081/#/viewer/new?actions=%5B%7B%22type%22:%22CATALOG:ADD_LAYERS_FROM_CATALOGS%22,%22layers%22:%5B%22testtitle%22%5D,%22sources%22:%5B%7B%22type%22:%22cog%22,%22url%22:%22https%3A%2F%2Fcogeo.craig.fr%2Fopendata%2Fortho%2Forthocraig3_vichy_2021.cog.tif%22%7D%5D%7D%5D should work and zoom to the provided COG
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information